<?php
class Shell_Command_News extends Shell_Command_Abstract_CommandBase
implements Shell_Command_Abstract_IShellCommand
{
        public function __construct()
        {
            parent::__construct();    
        	$this->NAME = "news";
        }

//*************************************************************************************************
        public function execute($arguments)
        {

                //TODO:
                /*
                                The $arguments array is already parsed and split by space, so the
arguments like this won't work: --someOPtion "spaced values".
                                Check if Zend_Console_Getopt has a built-in parser for the command
line as a whole. If it does, then maybe it should be used instead of
the built-in shell's parser?

                */

                $opts = new Zend_Console_Getopt(
                  array(
                        'feed|f=s' => 'feed option, with required string parameter',
                        'src|s-s' => 'src option, with optional string parameter',
                        'dummy|d' => 'dummy option with no parameters'
                  )
                );
				
                
                $opts->setArguments($arguments);

                try
                {
                        echo $opts->toString() . "\n";
                }
                catch (Zend_Console_Getopt_Exception $e)
                {
                        $usage = $e->getUsageMessage()."\n";
                        $progname = $_SERVER["SCRIPT_NAME"];
                        $usage = str_replace($progname, $this->getName(), $usage);
                        echo $usage . "\n";
                }

                /*
                $feed = $opts->getOption('f');
                $src = $opts->getOption('s');
                echo 'feed=' . $feed . "\n";
                echo 'src=' . $src . "\n";
                */

//                print_r($opts);
        }

}